function main() {
	var title = args.title;
	var ytUrl = args.ytUrl;
	var start = args.start;
	var hasConfigPermission = false;

	// Create XML object to pull values from
	// configuration file
	var conf = new XML(config.script);

	// Use the defaults from the XML configuration file
	// (youtube.get.config.xml) if no values in args array
	if (!title)
		title = conf.title[0].toString();

	if (!ytUrl)
		ytUrl = conf.ytUrl[0].toString();
	
	if (!start)
		start = conf.start[0].toString();

	// Work out if the user has permission to configure the dashlet

	if (page.url.templateArgs.site != null) {
		// Call the repository to see if the user is a site manager or not
		var obj = context.properties["memberships"];
		if (!obj) {
			var json = remote.call("/api/sites/" + page.url.templateArgs.site + "/memberships/"
					+ stringUtils.urlEncode(user.name));
			if (json.status == 200) {
				obj = eval('(' + json + ')');
			}
		}
		if (obj) {
			hasConfigPermission = (obj.role == "SiteManager");
		}
	} else {
		hasConfigPermission = true; // User dashboard
	}

	// Set values on the model for use in templates
	model.title = title;
	model.ytUrl = ytUrl;
	model.start = start;
	model.hasConfigPermission = hasConfigPermission;
}

main();